#ifndef QOS_CPP_FSCP_UTILS
#define QOS_CPP_FSCP_UTILS

#include <cstdint>

namespace qOS {

    /**
     * @brief FSCP Error Type enumeration
     * @details Defines different types of functional safety errors
     */
    enum class FSCP_ErrorType : std::uint32_t {
        CPU_ERROR       = 0x00000001U,    /**< CPU related error */
        MEMORY_ERROR    = 0x00000010U,    /**< Memory related error */
        TIMEOUT_ERROR   = 0x00000100U,    /**< Timeout error */
        DEADLINE_MISSED = 0x00001000U,    /**< Deadline missed for real-time tasks */
        CRITICAL_ERROR  = 0x00010000U,    /**< Critical system error */

        // Security-related errors for functional safety
        SECURITY_BREACH     = 0x00100000U,    /**< Security token violation */
        TOKEN_CORRUPTION    = 0x00200000U,    /**< Security token corruption detected */
        UNAUTHORIZED_ACCESS = 0x00400000U,    /**< Unauthorized access attempt */
        INTEGRITY_VIOLATION = 0x00800000U     /**< Data or state integrity violation */
    };

    /**
     * @brief Running Error Handler function type
     * @details Callback function type for handling functional safety errors
     * @param errorType Type of error that occurred
     * @param errorInfo Additional error information
     * @param pThis Pointer to the object that registered the handler
     */
    typedef void (*RunningErrorHandler)(FSCP_ErrorType errorType, const char *errorInfo, void *pThis);

} // namespace qOS

#endif // QOS_CPP_FSCP_UTILS
